<template>
  <nm-form-dialog ref="form" v-bind="form" v-on="on" :visible.sync="visible_">
    <el-row>
      <el-col :span="8">
        <el-form-item label="线路名称：" prop="route_name">
          <el-input v-model="form.model.route_name" clearable />
        </el-form-item>
      </el-col>
      <el-col :span="8">
        <el-form-item label="简拼：" prop="pinyin">
          <el-input v-model="form.model.pinyin" clearable />
        </el-form-item>
      </el-col>
      <el-col :span="8">
        <el-form-item label="起始站：" prop="start_stationid">
          <!-- <el-input v-model="form.model.start_stationid" clearable /> -->
            <el-select v-model="form.model.start_stationid" filterable placeholder="请选择">
                <el-option
                v-for="item in stationList"
                :key="item.value"
                :label="item.label"
                :value="item.value">
                </el-option>
            </el-select>
        </el-form-item>
      </el-col>
      <el-col :span="8">
        <el-form-item label="终点站：" prop="end_Stationid">
          <!-- <el-input v-model="form.model.end_Stationid" clearable /> -->
            <el-select v-model="form.model.end_Stationid" filterable placeholder="请选择">
                <el-option
                v-for="item in endList"
                :key="item.value"
                :label="item.label"
                :value="item.value">
                </el-option>
            </el-select>
        </el-form-item>
      </el-col>
      <el-col :span="8">
        <el-form-item label="线路类型" prop="route_type">
        <el-select v-model="form.model.route_type" placeholder="请选择">
          <el-option label="高速" value="1"></el-option>
          <el-option label="普通" value="2"></el-option>
          <el-option label="其它" value="3"></el-option>
        </el-select>
        </el-form-item>
      </el-col>
      <el-col :span="8">
        <el-form-item label="所属车站：" prop="subordinateid">
          <!-- <el-input v-model="form.model.subordinateid" clearable /> -->
            <el-select v-model="form.model.subordinateid" filterable placeholder="请选择">
                <el-option
                v-for="item in organizationList"
                :key="item.value"
                :label="item.label"
                :value="item.value">
                </el-option>
            </el-select>
        </el-form-item>
      </el-col>
      <el-col :span="8">
        <el-form-item label="区域类别：" prop="district_type">
          <el-select v-model="form.model.district_type" placeholder="请选择">
            <el-option label="县内" value="1"></el-option>
            <el-option label="县际" value="2"></el-option>
            <el-option label="市际" value="3"></el-option>
            <el-option label="省际" value="4"></el-option>
          </el-select>
        </el-form-item>
      </el-col>
      <el-col :span="8">
        <el-form-item label="线路等级：" prop="grade">
            <el-select v-model="form.model.grade" placeholder="请选择">
              <el-option label="一类客运班线" value="1"></el-option>
              <el-option label="二类客运班线" value="2"></el-option>
              <el-option label="三类客运班线" value="3"></el-option>
              <el-option label="四类客运班线" value="4"></el-option>
            </el-select>
        </el-form-item>
      </el-col>
      <el-col :span="8">
        <el-form-item label="线路方向：" prop="direction">
          <el-input v-model="form.model.direction" clearable />
        </el-form-item>
      </el-col>
      <el-col :span="8">
        <el-form-item label="里程：" prop="mileage">
          <el-input v-model="form.model.mileage" clearable />
        </el-form-item>
      </el-col>
      <el-col :span="8">
        <el-form-item label="状态：" prop="status">
            <el-select v-model="form.model.status" placeholder="请选择">
              <el-option label="启用" :value="true"></el-option>
              <el-option label="禁用" :value="false"></el-option>
            </el-select>
        </el-form-item>
      </el-col>
      <el-col :span="8">
        <el-form-item label="运行时长：" prop="run_time">
          <el-input v-model="form.model.run_time" clearable />
        </el-form-item>
      </el-col>
      <el-col :span="8">
        <el-form-item label="备注：" prop="remark">
          <el-input v-model="form.model.remark" clearable />
        </el-form-item>
      </el-col>
    </el-row>
  </nm-form-dialog>
</template>
<script>
import { mixins } from 'netmodular-ui'

const { add, edit, update } = $api.dispatch.route_Info

export default {
  props:['stationList', 'endList', 'organizationList'],
  mixins: [mixins.formSave],
  data() {
    return {
      title: '线路表',
      actions: { add, edit, update },
      form: {
        model: {
          /** 线路名称 */
          route_name: '',
          /** 简拼 */
          pinyin: '',
          /** 起始站编号 */
          start_stationid: '',
          /** 终点站编号 */
          end_Stationid: '',
          /** 线路类型：1 高速、2 普通、3 其它 */
          route_type: '',
          /** 所属车站 */
          subordinateid: '',
          /** 区域类别：1 县内、2 县际、3 市际、4 省际 */
          district_type: '',
          /** 线路等级：1 一类客运班线、2 二类客运班线、3 三类客运班线、4 四类客运班线 */
          grade: '',
          /** 线路方向 */
          direction: '',
          /** 里程 */
          mileage: '',
          /** 状态 1启用，2禁用 */
          status: '',
          /** 运行时长 */
          run_time: '',
          /** 备注 */
          remark: ''
        },
        rules: {}
      }
    }
  }
}
</script>
